<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8" isELIgnored="false"%>
<%@ include file="/WEB-INF/views/shared/taglib.jsp"%>
<%
	request.setAttribute("modelConfigPath", "billing");
%>
<%@ include file="/WEB-INF/views/shared/master/contentHeader.jsp"%>
<style >
	#outStockInfoCopy{display:none}
	.thumbnail{margin: 0px}
	#logo{margin: 0px;padding: 0px;}
	#pic{padding: 0px;height:60px;width:60px;}
	td input{margin-top:-1px;margin-bottom:-1px;height:21px; width:98%;border:none;color:red}
	#area{
		height:362px;
		width:1180px;
		overflow-y:auto; 
		overflow-x:hidden; 
	}
	
	body{
		font-size:1.4em ;
		font-family:黑体,微软雅黑;
	}
	.table{
		border:black 1px solid !important;
	}
	.table tr th{
		border:black 1px solid !important;
		text-align: center;
		padding:0px 2px !important;
	}
	.table tr td{	
		border:black 1px solid !important;
		padding:0px 2px !important;
		text-align: center;
	}
</style>
<script type="text/javascript">
 	function paceDoneCallback(){
		window.print(); 
		top.$("#modal_print_form").modal("hide");
	}  
</script>
<div id="printContent" >
	<c:set var="nullAll"  value="0"/>
	<c:set var="realPriceAll"  value="0"/>
	<c:set var="sequence"  value="0"/>
	<c:forEach var="outStockShow" items="${billing.outStock.outStockShows}">
		<c:forEach var="outStockCollocation" items="${outStockShow.outStockCollocations}" >
			<c:if test="${(sequence)%10==0&&sequence!=0}">
				<div style="page-break-after:always"></div>
			</c:if>
			<c:if test="${sequence==0}">
				<div class="text-center"><h2>${shop.shopName}销售单</h2></div>
				    <div class="row">
				    	<div class="col-md-4 col-sm-4">客户：${billing.customer.customerName}</div>
				    	<div class="col-md-4 col-sm-4">开单日期：<fmt:formatDate value="${billing.createDate}" type="date" dateStyle="default" pattern="yyyy-MM-dd"/></div>
				    	<div class="col-md-4 col-sm-4">订单号：${billing.billingNo}</div>
				    </div>
				    <div class="row">
				    	<div class="col-md-4 col-sm-4">收货地址：${billing.address}</div>
				    	<div class="col-md-4 col-sm-4">联系电话：${billing.customer.customerTel}</div>
				    	<div class="col-md-4 col-sm-4">欠款：<fmt:formatNumber value="${billing.unpaidAmount}" pattern="0.00"></fmt:formatNumber></div>
				    </div>
			</c:if>
			
			<c:if test="${(sequence)%10==0||sequence==0}">
				<table class="table ">
					<tr>
						<th style="width:50px">序号</th>
			           	<th style="width:100px">条形码</th>
			           	<th style="width:250px">商品名称</th>
			           	<th style="width:100px">规格</th>
			           	
			           	<th style="width:50px">单位</th>
			           	<th style="width:50px">数量</th>
			           	<th style="width:50px">单价</th>
			           	<th colspan="2">小计</th>
					</tr>
				</c:if>
				<c:set var="nullAll"  value="${nullAll +outStockCollocation.collocationNum}"/>
				<c:set var="realPriceAll"  value="${realPriceAll +outStockCollocation.realPrice*outStockCollocation.collocationNum}"/>
				<tr id="outStockCollocation_${sequence}">
					<td style="width:50px">${sequence +1}</td>				
		           	<td style="width:100px">${outStockShow.cargo.shapeCode}</td>
		           	<td style="width:250px">${outStockShow.cargo.cargoName}</td>
		           	<td style="width:50px">${outStockCollocation.collocation.propertyNameOne}/${outStockCollocation.collocation.propertyNameTwo}</td>
		           
					<td style="width:50px">${outStockShow.cargo.unit}</td>
					<td style="width:50px">${outStockCollocation.collocationNum}</td>
					<td style="width:50px"><fmt:formatNumber value="${outStockCollocation.realPrice}" pattern="0.00"></fmt:formatNumber></td>
					<td colspan="2"><fmt:formatNumber value="${outStockCollocation.realPrice*outStockCollocation.collocationNum}" pattern="0.00"></fmt:formatNumber></td>
				</tr>
				<c:set var="sequence"  value="${sequence +1}"/>
				<c:if test="${sequence==count&&count!=10}">
					<tr>
						<td colspan="2">合计:</td>
						<td colspan="3">${tfn:toChinaMoney(realPriceAll)}</td>
						<td ><fmt:formatNumber value="${nullAll}" pattern="0.00"></fmt:formatNumber></td>
			           	<td ></td>
			           	<td ><fmt:formatNumber value="${realPriceAll}" pattern="0.00"></fmt:formatNumber></td>
					</tr>
					
				</c:if>
				<c:if test="${(sequence)%10==0||sequence==0}">
					<tr>
						<td colspan="2">合计:</td>
						<td colspan="3">${tfn:toChinaMoney(realPriceAll)}</td>
						<td ><fmt:formatNumber value="${nullAll}" pattern="0.00"></fmt:formatNumber></td>
			           	<td ></td>
			           	<td ><fmt:formatNumber value="${realPriceAll}" pattern="0.00"></fmt:formatNumber></td>
					</tr>
					
				</c:if>
			
			<c:if test="${(sequence)%10==0||sequence==count}">
				</table>
			</c:if>
			<c:if test="${sequence==count}">
				
					<div class="row" style="margin-top:10px">
						<div class="col-md-12 col-sm-12">备注：${describe}</div>
					</div>
					<div class="row">
				    	<div class="col-md-5 col-sm-5">工行：${billingPrint.work }</div>
				    	<div class="col-md-4 col-sm-4">建行：${billingPrint.CCB }</div>
				    	<div class="col-md-3 col-sm-3">农行：${billingPrint.ABC }</div>
				    </div>
				    <div class="row">
				    	<div class="col-md-5 col-sm-5">地址：${billingPrint.address }</div>
				    	<div class="col-md-4 col-sm-4">电话：${billingPrint.tel }</div>
				    	<div class="col-md-3 col-sm-3">QQ：${billingPrint.QQ }</div>
				    </div>
				    <div class="row">
				    	<div class="col-md-5 col-sm-5">网址：${billingPrint.myUrl }</div>
				    	<div class="col-md-4 col-sm-4">业务员：${billing.businessName }</div>
				    	<div class="col-md-3 col-sm-3">客户签字：</div>
				    </div>
			</c:if>
		</c:forEach>
	</c:forEach>
</div>

<script type="text/javascript">

</script>
<%request.setAttribute("noScripts","formpickers.location;"); %>
<%@ include file="/WEB-INF/views/shared/base/scripts/jqueryui.jsp"%>
<%@ include file="/WEB-INF/views/shared/base/scripts/limitless/default/formvalidations.jsp"%>
<%@ include file="/WEB-INF/views/shared/base/scripts/limitless/default/notifications.jsp"%>
<%@ include file="/WEB-INF/views/shared/base/scripts/limitless/default/ui/moment.jsp"%>
<%@ include file="/WEB-INF/views/shared/base/scripts/limitless/default/formpickers.jsp"%>
<%@ include file="/WEB-INF/views/shared/master/contentFooter.jsp"%>